home *** CD-ROM | disk | FTP | other *** search
-
-
- Listing 1
- Function Definitions for K&R and ANSI
-
-
- #define ANSI 1
- #include <stdio.h>
- #include <myheader.h>
-
- int main()
- {
- int i;
-
- for (i = 0; i < 10; i++)
- printf("\n%d", func1(i));
- }
-
-
- #ifdef ANSI
-
- int func1(int i) /* For an ANSI compiler */
-
- #else
-
- int func1(i) /* For a K&R compiler */
- int i;
-
- #endif
- {
- return i * i;
- }
-
-